public final class Point implements Comparable<Point> {
	
	
	private final int row;
	private final int col;

	public Point(final int row, final int col) {
		this.row = row;
		this.col = col;
	}

	public int getRow() {
		return row;
	}

	public int getCol() {
		return col;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int hashcode = 5;
		hashcode = hashcode * prime + row;
		hashcode = hashcode * prime + col;
		return hashcode;
	}

	@Override
	public boolean equals(Object other) {
		if (other instanceof Point) {
			final Point point = (Point) other;
			return getRow() == point.getRow() && getCol() == point.getCol();
		}
		return false;
	}

	@Override
	public String toString() {
		return String.format("Row: %s, Col: %s]", row, col);
	}

	@Override
	public int compareTo(Point other) {
		int result = getRow() - other.getRow();
		if (result != 0) {
			return result;
		}
		return getCol() - other.getCol();
	}
}